package com.weixing.mall.core.support.auth;

import com.weixing.mall.base.constant.GlobalConstant;
import com.weixing.mall.util.ThreadLocalMap;

/**
 * @ClassName AuthUtil
 * @Description
 * @Author Small
 * @Date 2020/3/22 11:05
 * @Version 1.0
 **/
public class AuthUtil {
    public static AuthDto getAuthDto(){
        Object obj = ThreadLocalMap.get(GlobalConstant.TLMK_USER_AUTH_DTO);
        return null == obj ? null : (AuthDto) obj;
    }

    public static SysAuth getSysExt(){
        AuthDto authDto = getAuthDto();
        return null == authDto ? null : authDto.getSysExt();
    }

    public static MemAuth getMemberExt(){
        AuthDto authDto = getAuthDto();
        return null == authDto ? null : authDto.getMemberExt();
    }

    public static AgentAuth getAgentExt(){
        AuthDto authDto = getAuthDto();
        return null == authDto ? null : authDto.getAgentExt();
    }

}
